<div class='formulaire_spip'>
    [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV**{message_ok})</p>]
	[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
    
    <form method='post' action='#ENV{action}' id="ecatalogue_options_form" class="list_form"><div>
			#ACTION_FORMULAIRE{#ENV{action}}

        <div style="margin: 5px; text-align: center;">
            <B_groupes>
                <h2><:ecatalogue:groupe:></h2>
                [(#ENV{id_groupe}|?{#SET{id_groupe, #ENV{id_groupe}}})]
                <select style="width: 60%;" id="id_groupe" name="id_groupe">
                    <BOUCLE_groupes(ECATALOGUE_GROUPES){par num titre}>
                    [(#GET{id_groupe}|?{'', #SET{id_groupe, #ID_GROUPE}})]
                    <option value="#ID_GROUPE" [(#ENV{id_groupe}|=={#ID_GROUPE}|?{'selected'})]>
                    [(#TITRE|supprimer_numero)]
                    </option>
                    </BOUCLE_groupes>
                </select>
        </div>


        <div style="margin: 5px; text-align: center;">
            <B_proprietes>
            <h2><:ecatalogue:propriete:></h2>
            [(#ENV{id_propriete}|?{#SET{id_propriete, #ENV{id_propriete}}})]
            <select style="width: 60%;" id="id_propriete" name="id_propriete">#ENV{id_propriete}
                <BOUCLE_proprietes(ECATALOGUE_PROPRIETES){id_groupe = #GET{id_groupe}}{par num titre}>
                    [(#REM)If id_rubrique in #ENV, set get first id_propriete from this select]
                    [(#GET{id_propriete}|?{'', #SET{id_propriete, #ID_PROPRIETE}})]
                    <option value="#ID_PROPRIETE" [(#ENV{id_propriete}|=={#ID_PROPRIETE}|?{'selected'})]>
                        [(#TITRE|supprimer_numero)] - <?php echo _T('ecatalogue:propriete_type_#TYPE'); ?>
                    </option>                    
                </BOUCLE_proprietes>
            </select>
        </div>
                
            <center><h2><:ecatalogue:option_list:></h2></center>
            <table align="center" style="width: 30%;">
            <tbody class="elements_container">
            <tr >
                <th>ID</th>
                <th style="text-align:center;">Название</th>
                <BOUCLE_test_show_id_mot_in_options_edit(CONDITION){si #CONFIG{ecatalogue/show_id_mot_in_options_edit}}>
                    <th style="text-align:center;">ID_MOT</th>
                </BOUCLE_test_show_id_mot_in_options_edit>
                <th></th>
            </tr>
        <BOUCLE_options(ECATALOGUE_OPTIONS){id_propriete=#GET{id_propriete}}{par num titre}{pagination 50}>
            <tr>
                <td>#ID_OPTION</td>            
	            <td>
                    <input type="text" name="elements_update[#ID_OPTION][titre]" value="#TITRE**" style="width: 340px;" />
                </td>
                <BOUCLE_test_show_id_mot_in_options_edit2(CONDITION){si #CONFIG{ecatalogue/show_id_mot_in_options_edit}}>
                <td>
                    <input type="text" name="elements_update[#ID_OPTION][id_mot]" value="#ID_MOT" style="width: 20px;" />
                </td>	
                </BOUCLE_test_show_id_mot_in_options_edit2>
                <td>
                    <a href="javascript:;" data-element-id="#ID_OPTION" class="delete_link"><:ecatalogue:form_delete_element:></a>  
                </td>            
		    </tr>
        </BOUCLE_options>
        <tr><td colspan="2"><center>#PAGINATION</center></td></tr>
            </B_options>
                <tr><td colspan="2"><center><strong class="caption"><:ecatalogue:form_no_elements:></strong></center></td></tr>
                <//B_options>
            </tbody>
            </table>
			<div style="font-weight: bold; width: 100%; text-align: center;">
                <:ecatalogue:form_save_to_change:>
            </div>
			<p class='boutons'>
                <input type='button'  onclick="javascript:window.location.reload();" name='cancel_button' value='<:ecatalogue:cancel:>' />
                <input type='button' class="add_field_button" name='add_field_button' value='<:ecatalogue:form_add_element:>' />
				<input type='submit' name='save_submit' value='<:bouton_enregistrer:>' />
			</p>
            </B_proprietes>
                <h2><:ecatalogue:option_add_propriete_first:></h2>
            <//B_proprietes>			
		</div>
    </form>
</div>
<script src="#CHEMIN{formulaires/ecatalogue_options/ecatalogue_options_js.php}[?id_groupe=(#GET{id_groupe})&id_propriete=(#GET{id_propriete})]"></script>